package com.base2.webshop.client.factories.impl;

import com.base2.webshop.client.factories.ClientFactory;
import com.base2.webshop.client.presenters.LoginPresenter;
import com.base2.webshop.client.presenters.ProductDetailPresenter;
import com.base2.webshop.client.presenters.SearchMiniPresenter;
import com.google.inject.Inject;

public class ClientFactoryImpl implements ClientFactory {

	private LoginPresenter loginPresenter;
	private ProductDetailPresenter productDetailPresenter;
	private SearchMiniPresenter searchMiniPresenter;

	@Inject
	public ClientFactoryImpl() {
	}

	@Inject
	void setLoginPresenter(LoginPresenter loginPresenter) {
		this.loginPresenter = loginPresenter;
	}

	@Inject
	void setProductDetailPresenter(ProductDetailPresenter productDetailPresenter){
		this.productDetailPresenter=productDetailPresenter;
	}
	
	@Inject
	void setSearchMiniPresenter(SearchMiniPresenter searchMiniPresenter){
		this.searchMiniPresenter=searchMiniPresenter;
	}
	
	@Override
	public LoginPresenter getLoginPresenter() {
		if(loginPresenter!=null)
			return loginPresenter;
		return null; //TODO
	}

	@Override
	public ProductDetailPresenter getProductDetailPresenter() {
		if(productDetailPresenter!=null)
			return productDetailPresenter;
		return null; //TODO
	}

	@Override
	public SearchMiniPresenter getSearchMiniPresenter() {
		if(searchMiniPresenter!=null)
			return searchMiniPresenter;
		return null; //TODO
	}

}
